package com.example.minio.util;

import io.minio.MinioClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MinioConfig {

    private String endPoint="http://192.168.17.128:9000";
    //这里要用minio中自己创建的key
    private String accessKey="atYpZNvrNqsvJJvJopSD";
    //这里要用minio中自己创建的secretKey
    private String secretKey="GbRSnlM3BpDHlOGx9Gp4p4B5bcINBoNyc1nMCbL0";

    @Bean
    public MinioClient minioClient(){
       return MinioClient
               .builder()
               .endpoint(endPoint)
               .credentials(accessKey,secretKey).build();
    }
}
